package com.cuckoo.cuckoo_app2.enums;

import android.graphics.Color;

/**
 * 支付类型 支出 收入
 */
public enum PaymentType {
    INCOME(1, "收入", "+", Color.parseColor("#00E100")),
    OUTCOME(2, "支出", "-", Color.parseColor("#FF0000")),
    WITHDRAWAL(3, "待处理", "-", Color.parseColor("#0000FF"));

    private int code;
    private String type;
    private String symbol;
    private int color;

    PaymentType(int code, String type, String symbol, int color) {
        this.code = code;
        this.type = type;
        this.symbol = symbol;
        this.color = color;
    }

    public static PaymentType fromCode(int code) {
        for (PaymentType type : PaymentType.values()) {
            if (type.code == code) {
                return type;
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public String getSymbol() {
        return symbol;
    }

    public int getColor() {
        return color;
    }
}

